package com.atguigu.gulimall.auth.controller;

import com.atguigu.gulimall.auth.service.OAuthService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;

import javax.servlet.http.HttpSession;

/**
 * @DESCRIPTION: 处理社交登录请求
 * @author: zr
 * @DATE: 2023/1/6 22:32
 */
@Controller
public class OAuth2Controller {
    @Autowired
    private OAuthService oAtuhService;
    @GetMapping("oauth2.0/weibo/success")
    public String weiBo(@RequestParam("code") String code, HttpSession session) throws Exception {
     return oAtuhService.socialLogin(code,session);
    }
}
